package com.ls.controller.activityuser;

import com.ls.controller.activityuser.model.AddActivityUserModel;
import com.ls.controller.activityuser.model.EditActivityUserModel;
import com.ls.controller.activityuser.model.updateStatusModel;
import com.ls.service.IActivityUserService;
import com.ls.utils.ResultData;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 活动对象 前端控制器
 * </p>
 *
 * @author pengyu
 * @since 2024-10-12
 */
@Slf4j
@Api(value = "PC活动对象相关接口", tags = "PC活动对象相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/activityUser")
public class ActivityUserController {
    private final IActivityUserService service;
    /** 活动对象列表 */
    @GetMapping("pageList")
    public ResultData pageList(Integer validFlag) {
        return service.pageList(validFlag);
    }
    /** 新增活动对象 */
    @PostMapping("add")
    public ResultData add(@Valid @RequestBody AddActivityUserModel model) {
        return service.add(model);
    }
    /** 编辑活动对象 */
    @PostMapping("edit")
    public ResultData edit(@Valid @RequestBody EditActivityUserModel model) {
        return service.edit(model);
    }
    /**修改活动对象启用状态*/
    @PostMapping("updateStatus")
    public ResultData updateStatus(@Valid @RequestBody updateStatusModel model) {
        return service.updateStatus(model);
    }
}
